package business.impl;

import java.sql.ResultSet;
import java.util.List;

import model.TPractice;
import model.TStuexpe;
import model.VStuexpe;
import business.basic.iHibBaseDAO;
import business.basic.iHibBaseDAOImpl;
import business.dao.StuexpeDao;

public class StuexpeDaoIpml implements StuexpeDao {
	
	iHibBaseDAO bdao = null;
	public void setBdao (iHibBaseDAO bdao){
		this.bdao=bdao;
		
	}

	@Override
	public TStuexpe getstuexpeById(int id) {
		TStuexpe title = (TStuexpe) bdao.findById(TStuexpe.class,id);
		return title;
	}

	@Override
	public int addStuexpe(TStuexpe model) {
		Object obj = bdao.insert(model);
		if (obj == null) {
			return 0;
		}
		return 1;
	}

	@Override
	public boolean upStuexpe(TStuexpe model) {
		return bdao.update(model);
	}

	@Override
	public boolean delStuexpe(int id) {
		return bdao.delete(TStuexpe.class, id);
	}

	@Override
	public List<TStuexpe> getStuexpes(int id) {
		String sql = "from TStuexpe where stuinfoid =   ?";
		Object[] para = {id};
		List<TStuexpe> modl = bdao.select(sql,para);
		return modl;
	}

	@Override
	public List<VStuexpe> getV_Proexperslist(int id) {
		String sql = " from VStuexpe where stuinfoid =   ?";
		Object[] para = {id};
		List<VStuexpe> modl = bdao.select(sql,para);
		return modl;
	}

}
